//
//  ViewController.m
//  iCarStyle
//
//  Created by liunian on 13-9-25.
//  Copyright (c) 2013年 liunian. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (nonatomic, retain) UILabel   *theTitleLabel;
@end

@implementation ViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self.view setBackgroundColor:[UIColor flatWhiteColor]];
    _kSpaceHeight = 0;
    self.navigationController.navigationBar.tintColor = [UIColor flatWhiteColor];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.extendedLayoutIncludesOpaqueBars = NO;
    self.modalPresentationCapturesStatusBarAppearance = NO;
    [self.navigationController.navigationBar setBarTintColor:[UIColor flatBlueColor]];
//    [self.theTitleLabel setText:self.title];
//    self.navigationItem.titleView = self.theTitleLabel;

    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000

#else
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}
#endif

- (void)viewWillAppear:(BOOL)animated{
    [MobClick beginLogPageView:self.title];
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:self.title];
}
#pragma mark 
- (UILabel *)theTitleLabel{
    if (!_theTitleLabel) {
        _theTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 30)];
        _theTitleLabel.backgroundColor = [UIColor clearColor];
        _theTitleLabel.textAlignment = [Util getAlign:ALIGNTYPE_CENTER];
        _theTitleLabel.font = FONT_TITLE(16.0f);
        _theTitleLabel.textColor = [UIColor flatBlackColor];
    }
    return _theTitleLabel;
}
@end
